package com.ymatou.shop.ui.activity;

import com.ymatou.shop.R;
import com.ymatou.shop.ui.activity.buyer.PayOrderActivity;
import com.ymatou.shop.ui.activity.seller.AddProductActivity;
import com.ymatou.shop.ui.activity.seller.CameraActivity;
import com.ymatou.shop.ui.activity.seller.EventListActivity;
import com.ymatou.shop.ui.activity.seller.MainActivity;
import com.ymatou.shop.util.GlobalUtil;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class WelcomeActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_welcome);

		setupViews();

		toHome();
	}

	private Handler mHandler;

	public void toHome() {

		mHandler = new Handler(getMainLooper()) {
			@Override
			public void handleMessage(Message msg) {
				super.handleMessage(msg);
				//			GlobalUtil.startActivity(this, MainActivity.class);
				//			GlobalUtil.startActivity(this, AddProductActivity.class);
				if (getAccount().isLogin() && getAccount().isSeller()){
						GlobalUtil.startActivity(WelcomeActivity.this, UserinfoActivity.class);		
//						GlobalUtil.startActivity(WelcomeActivity.this, UserinfoActivity.class);		
				}else {
//					GlobalUtil.startActivity(WelcomeActivity.this, PayDepositActivity.class);	
					GlobalUtil.startActivity(WelcomeActivity.this, HomeActivity.class);	
				}
				
				finish();
			}
		};

		mHandler.sendEmptyMessageDelayed(0, 1500);
	}

	@Override
	protected void setupViews() {
		super.setupViews();
	}
}
